#include "LogicBase.h"

bool LogicBase::isOutOfBounds(int index, int size) {
	bool outOfBounds;

	if( index <= 0 ) {
		outOfBounds = true;
	} else if( index > size ) {
		outOfBounds = true;
	} else {
		outOfBounds = false;
	}

	return outOfBounds;
}

bool LogicBase::isMultipleMatches(int size) {
	
	bool multipleMatches;
	
	if( size == 1 ) {
		multipleMatches = false;
	} else {
		multipleMatches = true;
	}

	return multipleMatches;
}

Display LogicBase::getDisplay() {
	return _display;
}

LogicBase::LogicBase() {}

void LogicBase::initialize(Data* data, Writer* writer) {
	_data = data;
	_writer = writer;
}

const string LogicBase::NOT_FOUND_ERROR_MESSAGE = "Task Not Found";

const string LogicBase::INDEX_OUT_OF_BOUNDS_ERROR_MESSAGE = "Invalid Task Number";

const string LogicBase::FILE_EMPTY = "File Is Empty";

Data* LogicBase::_data = NULL;
Writer* LogicBase::_writer = NULL;
Display LogicBase::_display;